package com.zxy.ziems.server.file.enums;

import java.util.function.Function;

/**
 * @author chdzq
 * @create 2023/3/21
 */
public enum FileTypeEnum {
    DIR(0, "dir"),
    IMAGE(1, "image"),
    VIDEO(2, "video"),
    AUDIO(3, "audio"),
    DOC(4, "doc"),
    OTHER(5, "other");

    private final Integer key;
    private final String value;
    public static Function<Integer, String> getValue = (k) -> {
        String result = new String();
        FileTypeEnum[] var2 = values();
        int var3 = var2.length;

        for(int var4 = 0; var4 < var3; ++var4) {
            FileTypeEnum type = var2[var4];
            if (type.key.equals(k)) {
                result = type.value;
                break;
            }
        }

        return result;
    };

    private FileTypeEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return this.key;
    }

    public String getValue() {
        return this.value;
    }
}

